<%@ page contentType="text/html;charset=UTF-8" language="java" import="java.util.Date"%>
<%@ page import="java.util.Enumeration" %>
<!DOCTYPE html>
<html>
<head>
<title>输出</title>
</head>
<body>
  <div style="text-align: center">
    <%
        // request是ServletRequest类的示例
        request.setCharacterEncoding("UTF-8");
        // response是ServletResponse类的示例
        // response.setContentType("text/html;charset=UTF-8");
        out.print("你好，世界！<br>");
        out.print(new Date().toString() + "<br>");
        out.print("参数值<br>");
        Enumeration<String> names = request.getParameterNames();
        while (names.hasMoreElements()) {
            out.print(request.getParameter(names.nextElement()) + "<br>");
        }
    %>
    <%-- “(String) request.getParameter("text1")”表示将index.html发送的数据转换为String类型 --%>
    <span>
      转到
      <a href="print.jsp">print.jsp</a>
    </span>
  </div>
</body>
</html>
